package com.paomi.client.activity.vip;

import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
import com.paomi.client.activity.vip.model.MyCounponBean;
import com.paomi.client.activity.vip.view.MyVipView;
import com.paomi.client.bean.BaseJSON;
import com.paomi.client.net.Api;
import com.paomi.client.net.BaseCallback;
import com.paomi.client.net.Constants;
import com.paomi.client.view.LoadingDialog;

import retrofit2.Call;

/**
 * Created by pc on 2018/11/16
 * Describe:
 * com.paomi.client.activity.vip
 */
public class MyVipPresenter extends MvpBasePresenter<MyVipView> {
    /**
     * 获取vip等级和任务
     */
    public void getVip() {
        LoadingDialog.get().showLoading();
        Api.getInstanceService(Constants.User_URL).getVipLevel().enqueue(new BaseCallback<MyCounponBean>() {
            @Override
            public void onResponse(Call<MyCounponBean> call, MyCounponBean result) {
                getView().showVip(result.getReturnData());
            }
        });
    }

    /**
     * 领取权益的数据
     * @param id
     */
    public void getiInterestsIdDat(String id){
        Api.getInstanceService(Constants.User_URL).getMyInterest(id).enqueue(new BaseCallback<BaseJSON>() {
            @Override
            public void onResponse(Call<BaseJSON> call, BaseJSON result) {
                getView().getInterJsonData(result);
            }
        });
    }
}
